package cn.xinfei.xdecision.common.utils.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DataHelper {
    /**
     * 判断表达式的运算结果是否数值型的公共方法
     */
    public static boolean isNumeric(String str) {
        Pattern pattern = Pattern.compile("^(-|\\+)?\\d+(\\.\\d+)?$");
        Matcher isNum = pattern.matcher(str);
        if (!isNum.matches()) {
            return false;
        }
        return true;
    }
}
